| Fully Qualified Name: | CodeIgniter\HTTP\Header |
Class Header
Represents a single HTTP header.
| Name | Description | Defined By |
|---|---|---|
| __construct() | Header constructor. name is mandatory, if a value is provided, it will be set. | Header |
| __toString() | Returns a representation of the entire header string, including the header name and all values converted to the proper format. | Header |
| appendValue() | Appends a value to the list of values for this header. If the header is a single value string, it will be converted to an array. | Header |
| getName() | Returns the name of the header, in the same case it was set. | Header |
| getValue() | Gets the raw value of the header. This may return either a string of an array, depending on whether the header has multiple values or not. | Header |
| getValueLine() | Retrieves a comma-separated string of the values for a single header. | Header |
| prependValue() | Prepends a value to the list of values for this header. If the header is a single value string, it will be converted to an array. | Header |
| setName() | Sets the name of the header, overwriting any previous value. | Header |
| setValue() | Sets the value of the header, overwriting any previous value(s). | Header |
Header constructor. name is mandatory, if a value is provided, it will be set.
| Parameter Name | Type | Description |
|---|---|---|
| $name | string | |
| $value | string|array|null |
Returns:
Returns a representation of the entire header string, including the header name and all values converted to the proper format.
Returns: string
Appends a value to the list of values for this header. If the header is a single value string, it will be converted to an array.
| Parameter Name | Type | Description |
|---|---|---|
| $value | null |
Returns: $this
Returns the name of the header, in the same case it was set.
Returns: string
Gets the raw value of the header. This may return either a string of an array, depending on whether the header has multiple values or not.
Returns: array|null|string
Retrieves a comma-separated string of the values for a single header.
NOTE: Not all header values may be appropriately represented using comma concatenation. For such headers, use getHeader() instead and supply your own delimiter when concatenating.
Returns:
Prepends a value to the list of values for this header. If the header is a single value string, it will be converted to an array.
| Parameter Name | Type | Description |
|---|---|---|
| $value | null |
Returns: $this
Sets the name of the header, overwriting any previous value.
| Parameter Name | Type | Description |
|---|---|---|
| $name | string |
Returns: $this
Sets the value of the header, overwriting any previous value(s).
| Parameter Name | Type | Description |
|---|---|---|
| $value | null |
Returns: $this